package top.wettis.chat.controller;

import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import top.wettis.chat.constant.KeyWordsConstant;
import top.wettis.chat.constant.ResultType;
import top.wettis.chat.constant.SubjectConstant;
import top.wettis.chat.pojo.DO.Task;
import top.wettis.chat.pojo.VO.Result;
import top.wettis.chat.service.*;
import top.wettis.chat.service.impl.HistoryRecordServiceImpl;
import top.wettis.chat.service.impl.UserServiceImpl;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户提问历史记录 前端控制器
 * </p>
 *
 * @author wettis
 * @since 2023-03-25
 */
@RestController
@CrossOrigin
@RequestMapping("/chat")
public class HistoryRecordController {
    @Autowired
    private HistoryRecordServiceImpl historyRecordService;
    @GetMapping("/ask")
    public Result<Object> question(@RequestParam("question") String question) {return historyRecordService.question(question);}
    @GetMapping("/ask2")
    public Result<Object> ask(@RequestParam("question") String question) {
        return historyRecordService.ask(question);
    }
}
